#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>

using namespace std;

void myPrint(int val)
{
    cout << val << " ";
}

void test()
{
    vector<int> v1;
    for (size_t i = 0; i < 10; i++)
    {
        v1.push_back(i);
    }

    int total = accumulate(v1.begin(), v1.end(), 200);
    cout << "total = " << total << endl;

    fill(v1.begin(), v1.end(), 10);

    for_each(v1.begin(), v1.end(), myPrint);
    cout << endl;
}

int main()
{
    test();
    return 1;
}